package util.utls;

import android.os.CountDownTimer;
import android.widget.TextView;

/**
 * Created by itboye on 2016/12/27.
 */

public class TimeCount extends CountDownTimer {


    private TextView tv;

    public TimeCount(long millisInFuture, long countDownInterval,TextView tv) {
        super(millisInFuture, countDownInterval);
        this.tv=tv;
    }



    @Override
    public void onFinish() {
        tv.setText("重新验证");
        tv.setClickable(true);
    }

    @Override
    public void onTick(long millisUntilFinished) {
        tv.setClickable(false);
        tv.setText(millisUntilFinished / 1000 + "秒后重新发送");

    }

}
